package com.idealighter.game.gamerecord.handler;

import com.google.inject.Inject;
import com.idealighter.game.core.annotation.ReqMsgHandler;
import com.idealighter.game.gamerecord.manage.GameRecordMgr;
import com.idealighter.game.gamerecord.message.ReqGameRecordListMsg;
import com.idealighter.game.message.ModuleMsgIdConstant;
import com.idealighter.game.message.core.ReqMessage;
import com.idealighter.game.message.core.ResMessage;
import com.idealighter.game.player.struct.Player;
import com.idealighter.game.server.handler.ReqMessageHandler;

@ReqMsgHandler(ModuleMsgIdConstant.Group.GAME_RECORD_LIST)
public class ReqGameRecordListHandler implements ReqMessageHandler {

  @Inject
  private GameRecordMgr gameRecordMgr;

  @Override
  public ResMessage action(Player player, ReqMessage message) {
    ReqGameRecordListMsg msg = (ReqGameRecordListMsg) message;

    return gameRecordMgr.resGameRecordList(player, msg.getType(), msg.getLastCreateTime(),
        msg.getPageSize());
  }

}
